package org.example.item.controller;

import org.example.item.service.ItemService;
import org.example.model.vo.h5.HomeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/item")
public class ItemController {
    @Autowired
    private ItemService itemService;
    @RequestMapping("/list")
    public List<HomeVo> selectAll(){
        return itemService.selectAll();
    }
    @RequestMapping("/categoryId/{id}")
    public List<HomeVo> categoryId(@PathVariable("id") Long categoryId){
        return itemService.selectByCategoryId(categoryId);
    }
}
